using System;
using Ferpect.ComponentModel;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework.Input;

namespace $safeprojectname$
{
    public partial class StartScreen : Screen
    {
        public StartScreen()
        {
            InitializeComponent();
        }

        private void OnFocusChanged(object sender, EventArgs e)
        {
            if (this.HasFocus)
            {
                if (!GamePad.GetState(PlayerIndex.One).IsConnected
                    && !GamePad.GetState(PlayerIndex.Two).IsConnected
                    && !GamePad.GetState(PlayerIndex.Three).IsConnected
                    && !GamePad.GetState(PlayerIndex.Four).IsConnected)
                {
                    this.textSprite1.Text = "Press Enter";
                }
            }
        }

        private void OnStart(object sender, InputEventArgs e)
        {
            if (PlayerIndex.One <= e.PlayerIndex && e.PlayerIndex <= PlayerIndex.Four)
            {
                this.basicInput.GetInputService().PlayerOne = e.PlayerIndex;
            }
            this.ScreenManager.Goto(this.ScreenManager.MainScreen.Name, this.DrawOrder + 1);
        }
    }
}
